package com.lwm.base;

/**
 * @author liweimin
 * @date 2020/9/23 15:51
 * @description
 */
public class Student {
    private String name;
    private String stuId;
    private int age;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getStuId() {
        return stuId;
    }

    public void setStuId(String stuId) {
        this.stuId = stuId;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        if (age > 100 || age <= 0)
            System.err.println("请输入正确的年龄！");
        else
            this.age = age;
    }

    public Student(String name, String stuId, int age) {
        this.name = name;
        this.stuId = stuId;
        this.age = age;
    }

    public Student() {
    }

    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", stuId='" + stuId + '\'' +
                ", age=" + age +
                '}';
    }

    public static void main(String[] args) {
        Student student = new Student();
        student.setAge(112);
        student.setName("Lwmzzz");
        System.out.println(student.toString());
        Object o = new Student();
        System.out.println(o instanceof Student);
        System.out.println(o instanceof Object);
    }
}
